#region <!--##session ASPXBOListWholeClass##-->
		/*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
		##-->*/
<%@ Page Language="C#" MasterPageFile="~/DefaultMasterPage.master" AutoEventWireup="true"
			ValidateRequest="false" CodeFile="<!--##=className##-->List.aspx.cs" Inherits="<!--##=RepositoryManager.Instance.Repository.ProjectName##-->.Aspx.<!--##=accessorName##-->.<!--##=className##-->List" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Content" runat="Server">

		/*<!--##
		codeGeneratorVariable_DisplayCode.Append(ASPXBOListJaveScript() + Environment.NewLine);
		codeGeneratorVariable_DisplayCode.Append(ASPXBOListSearchFrame() + Environment.NewLine);
		codeGeneratorVariable_DisplayCode.Append(ASPXBOListResultFrame() + Environment.NewLine);
		##-->*/
</asp:Content>	
<!--##/session##-->
#endregion

#region <!--##session ASPXBOListSearchFrame##-->
        /*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
		
				
		//overriding entity.
		Entity entityBOPage =  RepositoryManager.Instance.Entities["BOPage",entityName];
		Entity entityBOListSearch =  RepositoryManager.Instance.Entities["BOListSearch",entityName];
		if(entityBOPage != null)
		{
			entityBOPage.OverridingEntity = entityBOListSearch;
		}
		entity.OverridingEntity = entityBOPage;

		##-->*/
    <uasp:Frame runat="server" ID="searchFrame" ImageURL="~/images/Search.gif" Title="<%$ resources:<!--##=className##-->,SearchFrameTitle %>" Width="100%">
        <uasp:FrameHeader>
            <uasp:FCell>
				
				<%-- Exporting Buttons --%>
                <table>
                    <tr>
                        <td >
                            <asp:ImageButton ID="btnExcelExport" ImageUrl="~/Images/exportxls.gif" runat="server" OnClick="btnExcelExport_Click" />
                        </td>
                        <td >
                            <asp:ImageButton ID="btnWordExport" ImageUrl="~/Images/exportdoc.gif" runat="server" OnClick="btnWordExport_Click" />
                        </td>
                    </tr>
                </table>
                <%-- /Exporting Buttons --%>
                
            </uasp:FCell>
        </uasp:FrameHeader>
        <uasp:FRow>
            <uasp:FCell>
				
				<asp:ValidationSummary id="vldrSummary" runat="server" HeaderText=""
                    ShowSummary="False" ShowMessageBox="True" ForeColor="#FF0000" />
				
				<%--Table for applying indentation --%>
				<table width="100%">
                    <tr>
						<td rowspan="2" width="1">&nbsp;
						</td>
                        <td>
                            <br />
                            <uasp:FrameWindow runat="server" ID="searchFrameWindow">
        /*<!--##
		int fieldIndex=0;
		int pairsCount=entity.FieldsCountInSingleRow;
		bool rangeHalfCompleted=false;
		while(fieldIndex<entity.SortedFields.Count)
		{
			
		##-->*/
								<uasp:FRow>
		/*<!--##	
			for(int i=0; i<pairsCount && fieldIndex<entity.SortedFields.Count;)
			{
				Entity.Field entityField = entity.SortedFields[fieldIndex];
				<%@EntityFieldIncludes%>
				if(dataType=="shortbinary" || dataType =="binary" || !displayed)
				{
					//move to next filed but dont increase 'i' pointer 
					fieldIndex++;
					continue;
				}
				else
				{
					//increase 'i' pointer
					i++;
				}
				
				string usedControl = (listTable == string.Empty)? webControl: listControl;
				string suffix = string.Empty;
				if(usingRange)
				{
					if(rangeHalfCompleted)
					{
						suffix = "_To";
						rangeHalfCompleted=false;
						fieldIndex++ ; //next time use other field.
					} 
					else
					{
						suffix = "_From";
						rangeHalfCompleted = true; //next time use same field for suffix 'To'
					}
				}
				else
				{
					//it has been consumed.
					fieldIndex++;
				}
		##-->*/
									<uasp:WCell CssClass="fwCellCaption" >
                                        <asp:Label ID="lbl<!--##=property##--><!--##=suffix##-->" runat="server" Text="<%$ resources:<!--##=className##-->,Field_<!--##=property##--><!--##=suffix##--> %>"/>
                                    </uasp:WCell>
                                    <uasp:WCell CssClass="fwCellValue">
                                        <uasp:<!--##=usedControl##--> ID="<!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##--><!--##=suffix##-->" runat="server" <!--##=strIsDecimalNumberAttb##--> Caption = "<%$ resources:<!--##=className##-->,Field_<!--##=property##--><!--##=suffix##--> %>"  <!--##=entityField.ASPXAttributes##-->  />
                                    </uasp:WCell>
                                    			
		/*<!--##	
			}
		##-->*/	
								</uasp:FRow>	
		/*<!--##
		}
		##-->*/
                            </uasp:FrameWindow>
                        </td>
                    </tr>
                    <tr>
                        <td >
                            <table width="1">
                                <tr>
                                    <td style="width: 100px">
                                        <uasp:ASCXButton ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="<%$ resources:GeneralResource,Caption_Search %>" />
                                    </td>
                                    <td style="width: 100px">
                                        <uasp:ASCXButton ID="btnReset" runat="server" Text="<%$ resources:GeneralResource,Caption_Reset %>" OnClientClick="ResetSearchPanel()" />
                                    </td>
                                </tr>
                            </table>
                            <br />
                        </td>
                    </tr>
                </table>
            </uasp:FCell>
        </uasp:FRow>
    </uasp:Frame>
<!--##/session##-->
#endregion

#region <!--##session ASPXBOListResultFrame##-->
        /*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
						
		//overriding entity.
		Entity entityBOPage =  RepositoryManager.Instance.Entities["BOPage",entityName];
		Entity entityBOListGrid =  RepositoryManager.Instance.Entities["BOListGrid",entityName];
		if(entityBOPage != null)
		{
			entityBOPage.OverridingEntity = entityBOListGrid;
		}
		entity.OverridingEntity = entityBOPage;

		##-->*/
	<uasp:Frame runat="server" ID="resultFrame" ImageURL="~/images/Result.gif" Title="<%$ resources:<!--##=className##-->,ResultFrameTitle %>" Width="100%" CssClass = "frameSearchResult" >
		<uasp:FrameHeader>
			<uasp:FCell>
				<table width="100">
					<tr>
						<td>
							<uasp:ASCXButton ID="btnAddNew" runat="server" Text="<%$ resources:GeneralResource,Caption_AddNew %>"  NavigateUrl="<!--##=className##-->Edit.aspx?Update=false"  />
						</td>
					</tr>
				</table>
	            
			</uasp:FCell>
		</uasp:FrameHeader>
		<uasp:FRow>
			<uasp:FCell VerticalAlign="Top" HorizontalAlign="Center">
				<asp:MultiView runat="server" ID="mvMessage">
					<asp:View runat="server" ID= "viewError">
						<table width="100%" class="tableError">
							<tr>
								<td>
									<asp:Label ID="lblError" runat="server" />
								</td>
							</tr>
						</table>
					</asp:View>
					<asp:View runat="server" ID= "viewInformation">
						<table width="100%" class="tableInformation">
							<tr>
								<td>
									<asp:Label ID="lblInformation" runat="server" />
								</td>
							</tr>
						</table>
					</asp:View>
				</asp:MultiView>
				<asp:MultiView runat="server" ID="mvSearchResult">
					<asp:View runat="server" ID= "viewRecordsFound" > 
						<asp:GridView ID="gv<!--##=className##-->" runat="server" CssClass="awTable" OnRowDataBound="gv<!--##=className##-->_RowDataBound"
							AutoGenerateColumns="false" Width="100%" OnRowCommand="gv<!--##=className##-->_RowCommand" OnRowEditing = "gv<!--##=className##-->_RowEditing"
							OnRowCreated="gv<!--##=className##-->_RowCreated" OnRowDeleting = "gv<!--##=className##-->_RowDeleting"  >
							<HeaderStyle Wrap="False" CssClass="awTableHeader" />
							<RowStyle CssClass="awTableRow" />
							<AlternatingRowStyle CssClass="awTableAltRow" />
							<EditRowStyle CssClass="awTableEditRow" />
							<FooterStyle CssClass="awTableFooter" />
							<SelectedRowStyle CssClass="awTableSelectRow" />
				            
							<Columns>
								<asp:TemplateField>
									<ItemStyle Wrap="True" CssClass= "awTableItemCheckBox" />
									<HeaderStyle Width="1" CssClass="awTableHeaderCheckBox" />
									<HeaderTemplate>
										<asp:CheckBox runat="server" ID="chkSelectAll" />
									</HeaderTemplate>
									<ItemTemplate>
										<asp:CheckBox runat="server" ID="chkSelect" />
									</ItemTemplate>
								</asp:TemplateField>
								<asp:TemplateField>
									<HeaderTemplate>
										<asp:Label runat="server" ID="lblSerialNumCaption" CssClass="awTableHeader" Text="<%$ resources:GeneralResource,Caption_SerialNum %>" />
									</HeaderTemplate>
									<ItemTemplate>
										<asp:Label ID="lblSerialNum" runat="server" />
										<asp:HiddenField ID = "hdnSerialNum" runat ="server"  />   
									</ItemTemplate>
								</asp:TemplateField>
			/*<!--##
            foreach(string entityFieldKey in entity.SortedFields.Keys)
            {
				Entity.Field entityField = entity.SortedFields[entityFieldKey];
				<%@EntityFieldIncludes%> 
				if(!displayed)
				{
					continue;
				}
				if(dataType == "shortbinary" || dataType == "binary")
				{
					//will handle it later
					continue;
				}
				string usedControl = (listTable == string.Empty)? webControl: listControl;
			##-->*/
								<asp:TemplateField>
									<ItemStyle Wrap="True" />
									<HeaderTemplate>
										<asp:LinkButton runat='server' ID="btn<!--##=property##-->" CommandName="Sort"
										CommandArgument="<!--##=entityFieldName##-->" Text = "<%$ resources:<!--##=className##-->,Field_<!--##=property##--> %>"  />
									</HeaderTemplate>
									<ItemTemplate>
										<uasp:<!--##=usedControl##--> ID="<!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->" runat="server" IsReadOnly="true" <!--##=strUsingTimeAttb##--> <!--##=strIsDecimalNumberAttb##--> <!--##=entityField.ASPXAttributes##--> />
									</ItemTemplate>
								</asp:TemplateField>
			/*<!--##	
			}
			##-->*/	
						<%-- Action Buttons --%>
								<asp:TemplateField>
									<ItemStyle Wrap="True" Width="1" HorizontalAlign="Left" />
									<HeaderStyle HorizontalAlign="Left" />
									<HeaderTemplate>
										<asp:Table runat="server" ID="tblActions" CellPadding="0" CellSpacing="0" BorderWidth="0">
											<asp:TableRow>
												<asp:TableCell ID="cellDeleteSelected" Width="1">
													<asp:ImageButton runat="server" ID="btnDeleteSelected" CommandName="DeleteSelected" ImageUrl="~/Images/delete.gif" CausesValidation="false" />    
												</asp:TableCell>
											</asp:TableRow>
										</asp:Table>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:Table runat="server" ID="tblRowActions"  CellPadding="0" CellSpacing="0" BorderWidth="0">
											<asp:TableRow>
												<asp:TableCell ID="cellEdit" Width="1">
													<asp:ImageButton runat="server" ID="btnEdit" CommandName="Edit" ImageUrl="~/Images/edit.gif" CausesValidation="false" />    
												</asp:TableCell>
												<asp:TableCell ID="cellDelete" Width="1">
													<asp:ImageButton runat="server" ID="btnDelete" CommandName="Delete" ImageUrl="~/Images/delete.gif" CausesValidation="false" />    
												</asp:TableCell>
											</asp:TableRow>
										</asp:Table>
									</ItemTemplate>
								</asp:TemplateField>
							</Columns>
						</asp:GridView>
						<uasp:Pager ID="pager<!--##=className##-->" runat="server"></uasp:Pager>
					</asp:View> 
					<asp:View ID="viewNoRecodFound" runat="server">
						<table width="100%" class="tableNoRecordFoundMessage">
							<tr>
								<td>
									<asp:Label ID="lblNoRecordFoundMessage" runat="server"
									Text="<%$ resources:GeneralResource,Message_NoRecordFound %>" />
								</td>
							</tr>
						</table>
					</asp:View>
				</asp:MultiView>
			</uasp:FCell>
		</uasp:FRow>
    </uasp:Frame>

<!--##/session##-->
#endregion

#region <!--##session ASPXBOListJaveScript##-->
        /*<!--##
		Entity entity = RepositoryManager.Instance.ActiveEntity;
		<%@EntityIncludes%>
				
		//overriding entity.
		Entity entityBOPage =  RepositoryManager.Instance.Entities["BOPage",entityName];
		Entity entityBOListSearch =  RepositoryManager.Instance.Entities["BOListSearch",entityName];
		if(entityBOPage != null)
		{
			entityBOPage.OverridingEntity = entityBOListSearch;
		}
		entity.OverridingEntity = entityBOPage;

		##-->*/
		<%--Jave Script--%>
		<script type="text/javascript">
			function ResetSearchPanel()
			{
		/*<!--##
        foreach(string entityFieldKey in entity.Fields.Keys)
        {
            Entity.Field entityField = entity.Fields[entityFieldKey];
            <%@EntityFieldIncludes%> 
			if(!displayed)
			{
				continue;
			}
			if(dataType == "shortbinary" || dataType == "binary")
			{
				//will handle it later
				continue;
			}
			string usedControl = (listTable == string.Empty)? webControl: listControl;
			if(!usingRange)
			{
        ##-->*/
				<%= <!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->.ClientID%>.ResetValue();
		/*<!--##
			}
			else
			{
		##-->*/
	
				<%= <!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->_From.ClientID%>.ResetValue();
				<%= <!--##=FreeHash.ControlPrefix[usedControl]##--><!--##=property##-->_To.ClientID%>.ResetValue();
		
		/*<!--##	
			}	
        }
		##-->*/
			}
		</script>
<!--##/session##-->
#endregion




